<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
        <link rel="stylesheet" type="text/css" href="css/estilo.css" media="screen" />
        <script type="text/javascript" src="jscript/valida.js"></script>
        <script type="text/javascript" src="jscript/jquery-1.7.1.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="jscript/CadastroAlunos.js"></script>
        <script type="text/javascript" src="jscript/funcoes.js"></script>
    </head>
    <body>
    <div id="wrapper">
        <div id="topo"></div>
        <div id="conteudo">
            <form id="cadastro" name="cadastro" method="post" onsubmit="return false;">
                <div id="conteudo-central">
                    <?php
                        require_once 'classes/class.ConexaoBD.php';
                        
                        $URL = $_SERVER['HTTP_REFERER'];
                        $strExplode = explode("/", $URL);
                        $arrayReverso = array_reverse($strExplode);
                        $NomeCurso = $arrayReverso[0];
                        
                        $ClsBD = new ConexaoBD;

                        $strSQL = "SELECT * FROM postos ORDER BY Posto";
                        $Postos = $ClsBD->ExecutarQry($strSQL, "S");
                    ?>
                    <h2> Preencha os dados abaixo para solicitar sua matrícula no Curso:<?php echo " " . $NomeCurso; ?></h2><br>
                    <span class="AlturaLinha"> Nome: </span><br><input type="text" id="txtNome" value="" size="50" class="LinhaInput" /><span style="color: red; font-weight: bold">*</span><br>
                    <span class="AlturaLinha"> NIP:</span><br><input type="text" id="txtNIP" value="" size="30" class="LinhaInput" /><br>
                    <span class="AlturaLinha"> CPF:</span><br><input type="text" id="txtCPF" value="" size="30" class="LinhaInput" /><span style="color: red; font-weight: bold">*</span><br>
                    <span class="AlturaLinha"> Posto/Graduação:</span><br><select id="cmbPosto">
                    <?php 
					if(is_resource($Postos))
                        while($Linha = mysql_fetch_assoc($Postos)) { ?>
                            <option value="<?php echo $Linha['Posto']; ?>">
                            <?php echo $Linha['Posto']; ?>
                            </option>
                    <?php } ?>
                    </select>
                    <span style="color: red; font-weight: bold">*</span>
                    <br>
                    <span class="AlturaLinha"> Função:</span><br><input type="text" id="txtFuncao" value="" size="30" class="LinhaInput" /><span style="color: red; font-weight: bold">*</span><br>
                    <span class="AlturaLinha"> OM:</span><br><input type="text" id="txtOM" value="" size="50" class="LinhaInput" /><span style="color: red; font-weight: bold">*</span><br>
                    <span class="AlturaLinha"> Sexo:</span><br><select id="cmbSexo"><option value="F">Feminino</option><option value="M">Masculino</option></select><span style="color: red; font-weight: bold">*</span><br>
                    <span class="AlturaLinha"> E-Mail Funcional:</span><input type="text" id="txtEMail" value="" size="98" class="LinhaInput" /><span style="color: red; font-weight: bold">*</span><br>
                    <span class="AlturaLinha"> E-Mail Alternativo:</span><input type="text" id="txtEMail_Alt" value="" size="98" class="LinhaInput" /><br>
                    <input type="hidden" id="txtURL" value="<?=$_SERVER['HTTP_REFERER']; ?>"/><br>
                    <div id="botao">
                        <button id="cadastrar">Cadastrar</button>
                    </div>
                </div>
                <div id="waiting" class ="waiting" style="display:none"> Aguarde, Processando!!! </div>
            </form>
        </div>
        <div id="rodape">
            <span>Os campos marcados com </span><span style="color: red; font-weight: bold">*</span><span> são de caráter obrigatório.</span>
        </div>
    </div>
    </body>
</html>	